﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MenesDroid;
using Microsoft.Xna.Framework.Content;

namespace XNA_Game_Engine.Canvas
{
    class TutorialLevel3 : Frame
    {
        Texture2D tip;

        public TutorialLevel3(Game game, int x, int y, int frameWidth, int frameHeight)
            : base(game, x, y, frameWidth, frameHeight, false)
        {
            if (ActionsHandler.showTips)
                this._enabled = true;
        }

        public override void LoadContent(ContentManager content)
        {
            tip = content.Load<Texture2D>(@"Tips\tutorial_3");

            Texture2D closeButton = content.Load<Texture2D>(@"Buttons\understood_button");
            Buttons.Add(new clsButton(closeButton, closeButton, new Vector2((Width / 2) - 80, 460), new Vector2(160, 70), CloseEvent));

        }


        public override void Update(GameTime gameTime)
        {
            if (!_enabled)
                return;

            base.Update(gameTime);
        }


        public override void Render(SpriteBatch renderTarget)
        {
            if (!_enabled)
                return;

            renderTarget.Draw(tip, new Vector2(0, 0), Color.White);
            Buttons.Draw(renderTarget);
        }


        public void CloseEvent(object sender, EventArgs e)
        {
            this._enabled = false;
        }

    }
}
